
//创建web服务对象
const express = require('express')
const server = express()
//跨域
const cors = require('cors')
//CommonJS 标准导入lodash
const lodash = require('lodash')
//导入stuName.js
const { stuNameArr } = require('./stuName.js')

server.use(cors())
server.get('/api/rand', (req , res) => {
    const rand = lodash.random(0, 10)
    const strName = stuNameArr[rand]
    res.send(strName)
})

//监听端口号



server.listen(3000, () =>{
    console.log('五一放五天')
})